function SpeedSet(ply) -- this has nothing to do with speed lol
if ply:GetInfoNum("Shoulder_View") == 1 then
ply:CrosshairDisable()
ply:SetViewOffsetDucked(Vector(0,0,60))
else
ply:CrosshairEnable()
ply:SetViewOffsetDucked(Vector(0,0,25))
end
ply.KeyRel = true
		umsg.Start("KeyRel", ply)
		umsg.Bool(ply.KeyRel)
		umsg.End()
		--ply:ChatPrint(ply:GetInfoNum("Shoulder_View"))
end
hook.Add("PlayerSpawn","SpeedSet",SpeedSet)

--hook.Add("PlayerInitialSpawn","InitialCrosshair",SpeedSet)


function hurtanim(ply, attacker, hpl, amt)
ply:ViewPunch(Angle(math.random(-3,3)*(amt/4),math.random(-3,3)*(amt/4),math.random(-3,3)*(amt/4))) --to knock your view around more
ply:SetAnimation( ACT_SMALL_FLINCH) -- doesn't work
end
hook.Add("PlayerHurt","hurtanim",hurtanim)


function SprintPress(ply, key)
	if key == IN_SPEED then
	ply.KeyRel = false
		umsg.Start("KeyRel", ply)
		umsg.Bool(ply.KeyRel)
		umsg.End()
	end
end
hook.Add( "KeyPress", "SprintPress", SprintPress )

function SprintRelease(ply, key)
	if key == IN_SPEED then
	ply.KeyRel = true
		umsg.Start("KeyRel", ply)
		umsg.Bool(ply.KeyRel)
		umsg.End()
	end
end
hook.Add( "KeyRelease", "SprintRelease", SprintRelease)


